import { BasicPageParams, BasicFetchResult, BasicSortParams } from '/@/api/model/baseModel';

export type AccountSearchParams = BasicPageParams & {
  username?: string;
  id?: string;
};
export type AccountParams = BasicPageParams & {
  userName: string;
  password: string;
  role: string;
  dept: string;
  nickname: string;
  email: string;
  phoneNumber: string;
};

export type DeptParams = {
  deptName?: string;
  status?: string;
};

export type MenuParams = {
  menuName?: string;
  status?: string;
};

export interface AccountListItem {
  tenantId?: string;
  userName: string;
  name: string;
  surname?: string;
  email: string;
  phoneNumber?: string;
  isActive: boolean;
  lockoutEnabled: boolean;
  isDeleted: boolean;
  lastModificationTime: string;
  creationTime: string;
  id: string;
}

/**
 * @description: Search params
 */
export type UserListBySearchParams = BasicPageParams & {
  deptId?: string;
};
export type DeptListBySearchParams = BasicPageParams & {
  DisplayName?: string;
};
export type SecurityLogsListBySearchParams = BasicPageParams & {
  userName?: string;
};
export type MenuListBySearchParams = {
  name?: string;
};
export type RoleParams = {
  filter?: string;
};

export type RolePageParams = BasicPageParams & RoleParams;
/**
 * @description: list of item
 */
export interface UserListItem {
  tenantId?: string;
  userName: string;
  name: string;
  surname?: string;
  email: string;
  phoneNumber?: string;
  isActive: boolean;
  lockoutEnabled: boolean;
  isDeleted: boolean;
  lastModificationTime: string;
  creationTime: string;
  id: string;
}
export interface DeptListItem {
  code: string;
  creationTime: string;
  displayName: string;
  id: string;
  parentId?: string;
  tenantId?: string;
}
export interface RoleListItem {
  id: string;
  name: string;
  isDefault: boolean;
  isStatic: boolean;
  isPublic: boolean;
  concurrencyStamp: string;
}
export interface PermissionInfo {
  name: string;
  entityDisplayName: string;
  groups: PermissionItem[];
}
export interface PermissionItem {
  name: string;
  displayName: string;
  parentName?: string;
  isGranted: boolean;
  permissions: PermissionItem[];
}
export interface UserDeptInfo {
  organizationUnitId: string;
}
export interface UserRoleInfo {
  id: string;
  name: string;
}
export interface SecurityLogsItem {
  id: string;
  tenantId?: string;
  applicationName: string;
  identity: string;
  action: string;
  userId: string;
  userName: string;
  tenantName?: string;
  clientId: string;
  correlationId: string;
  clientIpAddress: string;
  browserInfo: string;
  creationTime: string;
}
export interface MenuListItem {
  id: string;
  sort: string;
  routerName: string;
  routerPath: string;
  componentPath: string;
  name: string;
  parentId: string;
  icon: string;
  isState: boolean;
  isUrl: boolean;
  isKeepalive: boolean;
  creationTime: string;
  type: string;
  actions: string;
}
export interface RoleNaviationListItem {
  navigatioinId: string;
  name: string;
  parentId: string;
  isSelected: boolean;
  actions: RoleNavigationItemAction[];
  SelectActions;
}
export interface RoleNavigationItemAction {
  actionsName: string;
  isSelected: boolean;
  displayName: string;
  key: string;
}

export interface LanguageItem {
  cultureName: string;
  uiCultureName: string;
  displayName: string;
  flagIcon: string;
}
/**
 * @description: Request list return value
 */
export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;

//
export type UserListGetResultModel = BasicFetchResult<UserListItem>;
export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;
export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;
export type SecurityLogsListGetResultModel = BasicFetchResult<SecurityLogsItem>;
